<!DOCTYPE html>
<html xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout" layout:decorate="~{layout}">

<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />

    <title th:text="#{screen.pm.reset.title}">Reset Password Verify Questions View</title>
    <link href="../../static/css/cas.css" rel="stylesheet" th:remove="tag" />
</head>

<body>
    <main role="main" class="container mt-3 mb-3">
        <div layout:fragment="content" class="mdc-card">
            <div class="p-4">
                <h2 th:utext="#{screen.pm.reset.qstitle}">Answer Security Questions</h2>
                <p th:utext="#{screen.pm.reset.qsmsg(${username})}">Welcome <strong>{0}</strong>. Before you can reset
                    your password, you must answer the following security questions.</p>
            </div>
            <form method="post" id="fm1">
                <div class="p-4">
                    <input type="hidden" name="execution" th:value="${flowExecutionKey}" />
                    <input type="hidden" name="_eventId" value="submit" />
                    <input type="hidden" name="username" th:value="${username}" />
                    <input type="hidden" name="token" th:value="${token}" />

                    <div class="mdc-data-table p-4">
                        <table th:if="${questionsEnabled}" class="mdc-data-table__table w-100">
                            <tbody class="mdc-data-table__content">
                                <tr th:each="q,iterStat : ${questions}" class="mdc-data-table__header-row">
                                    <td class="mdc-data-table__cell" th:text="${q}">Question text</td>
                                    <td class="mdc-data-table__cell">
                                        <div>

                                            <label class="mdc-text-field mdc-text-field--outlined">
                                                <input class="mdc-text-field__input pwd"
                                                       type="password"
                                                       th:name="${'q' + iterStat.index}"
                                                       th:id="${'q' + iterStat.index}"
                                                       size="45"
                                                       autocomplete="off" required />

                                                <span class="mdc-notched-outline">
                                                    <span class="mdc-notched-outline__leading"></span>
                                                    <span class="mdc-notched-outline__notch">
                                                      <span class="mdc-floating-label"
                                                            th:utext="#{screen.pm.reset.answer(${iterStat.count})}">Answer</span>
                                                    </span>
                                                    <span class="mdc-notched-outline__trailing"></span>
                                                </span>
                                            </label>

                                        </div>
                                    </td>
                                </tr>
                                <tr class="mdc-data-table__header-row">
                                    <td class="mdc-data-table__cell"></td>
                                    <td class="mdc-data-table__cell">
                                        <button
                                            class="mdc-button mdc-button--raised mdc-card__action mdc-card__action--button mr-2"
                                            accesskey="s"
                                            th:attr="data-processing-text=#{screen.welcome.button.loginwip}"
                                            th:value="#{screen.pm.button.submit}" type="submit" value="SUBMIT">
                                            <span class="mdc-button__label"
                                                th:text="#{screen.pm.button.submit}">SUBMIT</span>
                                        </button>
                                    </td>
                                </tr>
                            </tbody>

                        </table>
                    </div>
                </div>
            </form>
        </div>
    </main>
</body>

</html>
